/**
 *  班组统计分析
 */

Ext.define('Module.sjfx.Bztj',{
	extend : 'Ext.panel.Panel',
	border: true,
	autoScroll:true,
	bodyStyle:{background:'rgb(219, 242, 239)'},
	layout:'column',
	initComponent : function() {
		var me = this;
		me.tbar = [{
			labelWidth:35,
			fieldLabel: '班组',
			xtype:'textfield'
		},{
		name:'startTime',
    	xtype:'datefield',
    	fieldLabel:'开始时间',
    	width:170,
    	labelWidth:60,
    	format:'Y-m-d',
    	value:''
    },{
		name:'endTime',
    	xtype:'datefield',
    	fieldLabel:'结束时间',
    	width:170,
    	labelWidth:60,
    	format:'Y-m-d',
    	value:''
    },{
    	xtype:'button',
    	padding:'0 0 0 5',
    	iconCls: 'icon-search',
    	text: '查询',
    	handler:function(){
    		var bzname = this.up('panel').down('field[fieldLabel=班组]').getValue();
			var startTime = this.up('panel').down('field[name=startTime]').getSubmitValue();
			var endTime = this.up('panel').down('field[name=endTime]').getSubmitValue();
			bzVideoCounts.update({
				params:{
					bzname:bzname,
					startTime:startTime,
					endTime:endTime
				}
			});
			bzTaskCounts.update({
				params:{
					bzname:bzname,
					startTime:startTime,
					endTime:endTime
				}
			});
		    bzFinishLv.update({
				params:{
					bzname:bzname,
					startTime:startTime,
					endTime:endTime
				}
			});
			bzWgVideoCounts.update({
				params:{
					bzname:bzname,
					startTime:startTime,
					endTime:endTime
				}
			});
    	}
    }];
		
		me.defaults = {columnWidth:1,padding:5};

		var bzFinishLv = Ext.create("Sh.ux.FusionChartPanel",{
			title:'班组任务完成率统计',
			height:300,
			swf:'javascript/fs/chart/Pie3D.swf',
			dataurl: 'bztj/getMonthFinishLv.do',
			columnWidth:1/3
		});
		var bzVideoCounts = Ext.create("Sh.ux.FusionChartPanel",{
			title:'班组关联视频统计',
			height:300,
			swf:'javascript/fs/chart/Column3D.swf',
			dataurl: 'bztj/bzVideoCounts.do',
			columnWidth:1
		});
		var bzTaskCounts = Ext.create("Sh.ux.FusionChartPanel",{
			title:'班组任务数量统计',
			height:300,
			swf:'javascript/fs/chart/Column3D.swf',
			dataurl: 'bztj/bzTaskCounts.do',
			columnWidth:1
		});
		var bzWgVideoCounts = Ext.create("Sh.ux.FusionChartPanel",{
			title:'班组违规视频统计',
			height:300,
			swf:'javascript/fs/chart/MSLine.swf',
			dataurl: 'bztj/bzWgVideoCounts.do',
			columnWidth:2/3
		});
		
		
		me.items = [bzTaskCounts,bzVideoCounts,bzFinishLv,
		            bzWgVideoCounts
		            ];
		me.callParent();
	}
});